package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizApplyBook;
import com.nmf.dao.gen.bean.BizApplyBookExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizApplyBookMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @SelectProvider(type=BizApplyBookSqlProvider.class, method="countByExample")
    long countByExample(BizApplyBookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @DeleteProvider(type=BizApplyBookSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizApplyBookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @Delete({
        "delete from biz_apply_book",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @Insert({
        "insert into biz_apply_book (id, title, ",
        "book_status, apply_type, ",
        "content, pdf_url, ",
        "user_id, user_name, ",
        "province_id, province_name, ",
        "category_id, category_name, ",
        "period_id, accept_uid, ",
        "accept_uname, opt_id, ",
        "opt_name, create_date, ",
        "update_date)",
        "values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ",
        "#{bookStatus,jdbcType=SMALLINT}, #{applyType,jdbcType=SMALLINT}, ",
        "#{content,jdbcType=LONGVARCHAR}, #{pdfUrl,jdbcType=VARCHAR}, ",
        "#{userId,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ",
        "#{provinceId,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, ",
        "#{categoryId,jdbcType=VARCHAR}, #{categoryName,jdbcType=VARCHAR}, ",
        "#{periodId,jdbcType=VARCHAR}, #{acceptUid,jdbcType=VARCHAR}, ",
        "#{acceptUname,jdbcType=VARCHAR}, #{optId,jdbcType=VARCHAR}, ",
        "#{optName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateDate,jdbcType=TIMESTAMP})"
    })
    int insert(BizApplyBook record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @InsertProvider(type=BizApplyBookSqlProvider.class, method="insertSelective")
    int insertSelective(BizApplyBook record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @SelectProvider(type=BizApplyBookSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="book_status", property="bookStatus", jdbcType=JdbcType.SMALLINT),
        @Result(column="apply_type", property="applyType", jdbcType=JdbcType.SMALLINT),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="pdf_url", property="pdfUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="category_id", property="categoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="category_name", property="categoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="period_id", property="periodId", jdbcType=JdbcType.VARCHAR),
        @Result(column="accept_uid", property="acceptUid", jdbcType=JdbcType.VARCHAR),
        @Result(column="accept_uname", property="acceptUname", jdbcType=JdbcType.VARCHAR),
        @Result(column="opt_id", property="optId", jdbcType=JdbcType.VARCHAR),
        @Result(column="opt_name", property="optName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BizApplyBook> selectByExample(BizApplyBookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @Select({
        "select",
        "id, title, book_status, apply_type, content, pdf_url, user_id, user_name, province_id, ",
        "province_name, category_id, category_name, period_id, accept_uid, accept_uname, ",
        "opt_id, opt_name, create_date, update_date",
        "from biz_apply_book",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="book_status", property="bookStatus", jdbcType=JdbcType.SMALLINT),
        @Result(column="apply_type", property="applyType", jdbcType=JdbcType.SMALLINT),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="pdf_url", property="pdfUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="category_id", property="categoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="category_name", property="categoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="period_id", property="periodId", jdbcType=JdbcType.VARCHAR),
        @Result(column="accept_uid", property="acceptUid", jdbcType=JdbcType.VARCHAR),
        @Result(column="accept_uname", property="acceptUname", jdbcType=JdbcType.VARCHAR),
        @Result(column="opt_id", property="optId", jdbcType=JdbcType.VARCHAR),
        @Result(column="opt_name", property="optName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    BizApplyBook selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @UpdateProvider(type=BizApplyBookSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizApplyBook record, @Param("example") BizApplyBookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @UpdateProvider(type=BizApplyBookSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizApplyBook record, @Param("example") BizApplyBookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @UpdateProvider(type=BizApplyBookSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizApplyBook record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_book
     */
    @Update({
        "update biz_apply_book",
        "set title = #{title,jdbcType=VARCHAR},",
          "book_status = #{bookStatus,jdbcType=SMALLINT},",
          "apply_type = #{applyType,jdbcType=SMALLINT},",
          "content = #{content,jdbcType=LONGVARCHAR},",
          "pdf_url = #{pdfUrl,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=VARCHAR},",
          "user_name = #{userName,jdbcType=VARCHAR},",
          "province_id = #{provinceId,jdbcType=VARCHAR},",
          "province_name = #{provinceName,jdbcType=VARCHAR},",
          "category_id = #{categoryId,jdbcType=VARCHAR},",
          "category_name = #{categoryName,jdbcType=VARCHAR},",
          "period_id = #{periodId,jdbcType=VARCHAR},",
          "accept_uid = #{acceptUid,jdbcType=VARCHAR},",
          "accept_uname = #{acceptUname,jdbcType=VARCHAR},",
          "opt_id = #{optId,jdbcType=VARCHAR},",
          "opt_name = #{optName,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizApplyBook record);
}